﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Agr.CQRS.Domain.Events
{
    [Serializable]
    public abstract class DomainEvent
    {
        [NonSerialized]
        private Guid aggregateRootId;
        public Guid AggregateRootId
        {
            get
            {
                return aggregateRootId;
            }
            set
            {
                aggregateRootId = value;
            }
        }

        [NonSerialized]
        private int version;
        public int Version
        {
            get
            {
                return version;
            }
            set
            {
                version = value;
            }
        }

        [NonSerialized]
        private int entityNumber;
        public int Entitynumber
        {
            get
            {
                return entityNumber;
            }
            set
            {
                entityNumber = value;
            }
        }

        [NonSerialized]
        private bool replaying;
        public bool Replaying
        {
            get
            {
                return replaying;
            }
            set
            {
                replaying = value;
            }
        }

        public override string ToString()
        {
            return string.Format("{0}.{1}/{2}.{3}", GetType().Name, aggregateRootId, version, entityNumber);
        }
    }
}
